package com.west.xu.provider.service.impl;

import com.west.xu.provider.domain.CombinationNum;
import com.west.xu.provider.service.IProviderService;
import com.west.xu.provider.util.NumberUtils;
import org.springframework.stereotype.Service;

@Service
public class ProviderServiceImpl implements IProviderService {
    @Override
    public Long factorial(Long number) throws RuntimeException {
        return NumberUtils.jiec(number).longValue();
    }

    @Override
    public Long combination(CombinationNum combinationNum) throws RuntimeException {
        return NumberUtils.zuhe(combinationNum.getUpNum(), combinationNum.getDownNum());
    }
}
